package com.itheima.service.impl;

import com.itheima.dao.BookDao;
import com.itheima.domain.Book;
import com.itheima.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class BookImpl implements BookService {
    @Autowired
    private BookDao bd;
    @Autowired
    private Book bk;

    @Override
    public List<Book> findAll() {
        return bd.selectAll();
    }

    @Override
    public boolean save(Book book) {
        bd.save(book);
        return true;
    }

    @Override
    public boolean update(Book book) {
        bd.update(book);
        return true;
    }

    @Override
    public boolean delete(Integer id) {
        bd.delete(id);
        return true;
    }

    @Override
    public Book findById(Integer id) {
        return bd.findById(id);
    }
}
